<template>
   <div class="common-layout">
    <el-container>      
      <el-container>
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
      >
        <h1 class="mb-2">Mock-API 管理</h1>        
        <el-menu-item index="1" @click="routeTo('/api-list')">
          <el-icon><icon-menu /></el-icon>
          <span>API 列表管理</span>
        </el-menu-item>
        <el-menu-item index="2" @click="routeTo('/api-content')">
          <el-icon><icon-menu /></el-icon>
          <span>API 内容管理</span>
        </el-menu-item>
      </el-menu>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'MainComponent', 
  data() {
     return {
        rightTitle:"API 列表管理"
     }
  },
  methods: {
    routeTo(link) {
      this.$router.push(link)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
